package com.tilaiedu.mvc.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author xlzhang
 * @Date 2022/5/24 9:52
 * @Version 1.0
 * @Description ControllerAdvice RestControllerAdvice 是后面要学习的统一异常处理的注解
 */
@Configuration
@ComponentScan(value = "com.tilaiedu.mvc",
        // 排除那些不需要这个配置扫描的注解
        excludeFilters = {
                // type 用来声明当前要排除的注解类型(那些注解修饰的类不需要扫描)
                @ComponentScan.Filter(type = FilterType.ANNOTATION,
                        classes = {Controller.class,
                                ControllerAdvice.class,
                                RestControllerAdvice.class})
        }
)
public class SpringConfig {
}
